/*  This file is part of -_-.

    -_- is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    -_- is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with -_-.  If not, see <http://www.gnu.org/licenses/>.

    Copyright 2012-2013 Oliver Katz */

#ifndef __OPAL_ERROR_H
#define __OPAL_ERROR_H

#include <iostream>
#include <sstream>
#include "lexer.h"

#include <unistd.h>

//namespace sleepyface::opal
namespace sleepyface
{
    namespace opal
    {
        extern unsigned int nerrors;

        void error(Token t, string file, string msg); //method: throw compile-time error
        //argof error: Token t: used to get the line number/column number for error display
        //argof error: string file: used to get the file name for error display
        //argof error: string msg: actual error message to display
        void note(string dsc, string val, string file); //method: add string data to last error
        //argof note: string dsc: description of data
        //argof note: string val: actual data
        //argof note: string file: used to get the file name for note display
        void note(string dsc, int val, string file); //method: add int data to last error
        void note(string dsc, string file); //method: add a message to last error
        bool dumpErrors(); //method: dump all errors
        //returnof dumpErrors: bool: true if there were any errors, otherwise false
        void exitIfErrors(); //method: exit if there were any errors (called dumpErrors)
    }
}

#endif
